﻿using SelfMadeMillionaire.Core;
using SelfMadeMillionaire.Core.Entities;
using SelfMadeMillionaire.Core.Enums;
using SelfMadeMillionaire.Core.Repositories;
using SelfMadeMillionaire.Core.Services;
using SelfMadeMillionaire.Core.Specifications;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SelfMadeMillionaire.BLL.Services
{
	public class PublicationProductService : IPublicationProductService
	{
		private readonly IPublicationProductRepository _publicationProductRepository;

        public PublicationProductService(IPublicationProductRepository publicationProductRepository)
		{
            _publicationProductRepository = publicationProductRepository;
		}

        public IEnumerable<PublicationProduct> GetByPublication(int id)
        {
            return _publicationProductRepository.GetAll(x => x.Publication.ID == id);
        }

		public void Remove(int id)
		{
            _publicationProductRepository.Remove(id);
		}

		
	}
}
